import type { RelatedInfo } from '@/api/types'
import { Difficulty, Taste } from '@/api/types'

interface BaseType {
    name: string;
    picture: string;
    describe: string;
    relatedInfo: RelatedInfo
}

/**
 * 食物基础信息
 * @param { name } 食物名
 * @param { describe } 描述
 * @param { relatedInfo } 基础关联信息
 */
class Base {
    name: string;
    describe: string;
    relatedInfo: RelatedInfo;
    picture: string;

    constructor(name: string, picture: string, describe: string, relatedInfo: RelatedInfo) {
        this.name = name;
        this.describe = describe;
        this.picture = picture;
        this.relatedInfo = relatedInfo;
    }

    static of({ name = '', picture = '', describe = '', relatedInfo = {
        difficulty: Difficulty.easy,
        cookingTime: '',
        taste: Taste.acid
    } }: {
        name?: string;
        picture?: string;
        describe?: string;
        relatedInfo?: RelatedInfo;
    }): Base {
        return new Base(name, picture, describe, relatedInfo);
    }
}


export {
    Base,
}